package com.vivachek.protocol.enums

/**
 * @Author: YCB
 * @Time: 2022/10/9 16:54:18
 * @Email: congbin.yuan@vivachek.com
 * @Description: 需要生成长度不为0的指令
 */
enum class CommandEnums(val command:Int,val expand:Int,val len1 : Int,val len2: Int) {
    SET_TIME(68,102,0,6)


    ;
    companion object{
        fun convert(command:Int,expand:Int,len1 : Int,len2: Int):CommandEnums{
            values().forEach {
                if (it.command==command && it.expand==expand && it.len1==len1 && it.len2==len2){
                    return it
                }
            }
            throw IllegalStateException("unknown command. command:$command,expand:$expand,len1:$len1,len2:$len2")
        }
    }
}